using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Profile;

public abstract class PageController : System.Web.UI.Page
{

    abstract protected void initialize();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (validateSession() && validateIdioma( ))
        {
            initialize();
        }
        else
        {
            Response.Redirect(Request.ApplicationPath + "/Default.aspx");
        }

    }

    private bool validateSession()
    {
        return (Session[SessionManager.USER_SESSION] == null) ? false : true;
    }

    private bool validateIdioma()
    {
        return (IdiomaCultura.datos.Count > 0) ? true : false;
    }

}